import Contacts from "./Contacts.js";
import ContactDetail from "./ContactDetail.js";
import './App.css';
import { initData, ContactContext } from "./context";
import React from "react";

class App extends React.Component {
  constructor(props) {
    super(props);

    this.state = Object.assign({}, initData, {
      setState: (state) => {
        this.setState(state);
      }
    });
  }

  render() {
    return (
      <ContactContext.Provider value={this.state}>
        <div className="App">
          <Contacts />
          <ContactDetail />
        </div>
      </ContactContext.Provider>
    );
  }
}

export default App;
